﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class UIWindowModel
{
    public static string GetWindowModel(string pageName, string uiName)
    {
        return PageModelFront + pageName + PageModelRear + uiName + PageModelEnd;
    }
    private const string PageModelFront =
        @"using huqiang.Core.HGUI;
using System;
using UnityEngine;
using huqiang.UIComposite;
using huqiang.UIEvent;
using huqiang;
using huqiang.Data;
using huqiang.UIModel;

public class ";
    private const string PageModelRear = @":PopWindow
{
    //反射UI界面上的物体
    class View
    {
    }
    View view;
    public override void Initial(UIElement parent, UIBase ui, object obj = null)
    {
        base.Initial(parent, ui, obj);
        view = LoadUI<View>(""baseUI"", """;
    private const string PageModelEnd = @""");//""baseUI""创建的bytes文件名,""page""为创建的页面名
    }
    public override void Show(object obj = null)
    {
        base.Show();
    }
    //语言切换功能用
    public override bool ChangeLanguage()
    {
        return base.ChangeLanguage();
    }
    //接收消息
    public override void Cmd(DataBuffer dat)
    {
        base.Cmd(dat);
    }
}";
}
